package io01;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("youdao.jpg");
        FileOutputStream fos = new FileOutputStream("youdao2.jpg");
        byte [] date = new byte[1024*10];
        int len ;
        long start = System.currentTimeMillis();
        while ((len = fis.read(date)) != -1){
            fos.write(date ,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println("耗时："+(end - start));
        fis.close();
        fos.close();
    }
}
